package model

type GoodsInfo struct {
	GoodsId            int    `json:"goodsId" gorm:"type:bigint;primary_key;not null;autoIncrement"`
	GoodsName          string `json:"goodsName" gorm:"type:varchar(200);not null"`
	GoodsIntro         string `json:"goodsIntro" gorm:"type:varchar(200);not null"`
	GoodsCategoryId    int    `json:"goodsCategoryId" gorm:"type:bigint;not null"`
	GoodsCoverImg      string `json:"goodsCoverImg" gorm:"type:varchar(200);not null;default:'/admin/dist/img/no-img.png'"`
	GoodsCarousel      string `json:"goodsCarousel" gorm:"type:varchar(500);not null;default:'/admin/dist/img/no-img.png'"`
	GoodsDetailContent string `json:"goodsDetailContent" gorm:"type:text;not null"`
	OriginalPrice      int    `json:"originalPrice" gorm:"type:int;not null"`
	SellingPrice       int    `json:"sellingPrice" gorm:"type:int;not null"`
	StockNum           int    `json:"stockNum" gorm:"type:int;not null"`
	Tag                string `json:"tag" gorm:"type:varchar(20);not null"`
	GoodsSellStatus    int    `json:"goodsSellStatus" gorm:"type:tinyint;not null"`
	CreateTime         Time   `json:"createTime" gorm:"type:datetime;not null;default:current_timestamp"`
	CreateUser         uint   `json:"createUser" gorm:"type:int;not null"`
	UpdateTime         Time   `json:"updateTime" gorm:"type:datetime;not null;default:current_timestamp"`
	UpdateUser         uint   `json:"updateUser" gorm:"type:int;not null"`
}

// TableName 自定义表明，不适用默认的mall_users
func (receiver GoodsInfo) TableName() string {
	return "tb_newbee_mall_goods_info"
}
